import React from 'react';
import { View, Text, FlatList, StyleSheet } from 'react-native';
import { colors, shadows, spacing } from '../../styles';
import SafeAreaView from '../../components/SafeAreaView';
interface Item {
  id: string;
  title: string;
  description: string;
}
const data: Item[] = [
  { id: '1', title: 'Item 1', description: 'Description for Item 1' },
  { id: '2', title: 'Item 2', description: 'Description for Item 2' },
  { id: '3', title: 'Item 3', description: 'Description for Item 3' },
  { id: '4', title: 'Item 4', description: 'Description for Item 4' },
];
const renderItem = ({ item }: { item: Item }) => (
  <View style={styles.item}>
    <Text style={styles.title}>{item.title}</Text>
    <Text style={styles.description}>{item.description}</Text>
  </View>
);
const ListSample = () => {
  return (
    <View style={styles.container}>
      <FlatList
        data={data}
        renderItem={renderItem}
        keyExtractor={item => item.id}
      />
    </View>
  );
};
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: colors.background,
    padding: spacing.padding.md,
  },
  item: {
    backgroundColor: colors.surface,
    padding: spacing.padding.md,
    marginVertical: spacing.margin.sm,
    borderRadius: 8,
  },
  title: {
    fontSize: 32,
  },
  description: {
    fontSize: 16,
  },
});
export default ListSample;
